package com.burgeon.backend.EnterpriseWeChat.controller;

import com.burgeon.backend.EnterpriseWeChat.service.EWEmpService;
import com.burgeon.backend.SHOPBACKEND.controller.BaseController;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
@CrossOrigin
@RequestMapping("ewapp/emp")
public class EWEmpController extends BaseController {
    @Autowired
    private EWEmpService ewEmpService;
    /**
     * 上传微信用户要发送的图片
     * @param file
     * @param token
     * @return
     */
    @RequestMapping("uploadEmpImg")
    public ResponseResult<String> uploadImg(MultipartFile file, String token, String empId){
        String data = ewEmpService.uploadImg(file, token,empId);
        return new ResponseResult(SUCCESS,data);
    }

    /**
     * 获取导购的头像
     * @param token
     * @param empId
     * @return
     */
    @RequestMapping("getEmpHeadImg")
    public ResponseResult<String> getEmpHeadImg(String token, String empId){
        String data = ewEmpService.getEmpHeadImg(empId,token);
        return new ResponseResult(SUCCESS,data);
    }
}
